package br.com.winesys.geta.databinding.componentBinder;

import br.com.winesys.geta.databinding.ComponentBinder;
import br.com.winesys.geta.databinding.component.selector.ObjectSelector;

public class ObjectSelectorBinder implements ComponentBinder<ObjectSelector<Object>> {

	private static final ComponentBinder<ObjectSelector<Object>> INSTANCE = new ObjectSelectorBinder();

	public static ComponentBinder<ObjectSelector<Object>> getInstance() {
		return INSTANCE;
	}

	private ObjectSelectorBinder() {
	}

	@Override
	public Object read(ObjectSelector<Object> component) {
		return component.getSelected();
	}

	@Override
	public void write(ObjectSelector<Object> component, Object value) {
		component.setSelected(value);
	}
}
